home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4012 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.dfn.de!si-nic!usenet
  2. From: Markus Becker <becker@zess.uni-siegen.de>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: #define, question from a beginner
  5. Date: Thu, 01 Feb 1996 11:50:32 +0100
  6. Organization: ZESS, Uni-GH-Siegen
  7. Message-ID: <31109AF8.423B@zess.uni-siegen.de>
  8. References: <ma-010296161301@mac147.maths.uwa.edu.au>
  9. NNTP-Posting-Host: becker.zess.uni-siegen.de
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  14.  
  15. ma wrote:
  16. snip
  17. > I can use #define to replace single lines#14 and 18. The following works.
  18.  
  19. > QUESTION: Can I use one single macro fiveLines to replace lines from 14 to
  20. > 18 inclusively? I tried the following but got rejected. Is there any way to
  21. > get around it? Note that lines 14 and 18 contain local variables.
  22.  
  23. You must use the "line-continuation" character -> "\"
  24. to continue a macro over more than one line.
  25.  
  26. > #define fiveLines       printf("%d, ",j); \               // macro should include this first                                            ==== here
  27. >                         /* comment is part of the macro \ // <- and here
  28. >                         the comment contains a few lines \ // <- and here
  29.  
  30. and so on.
  31.  
  32. Hope that helps.
  33. --
  34. Markus Becker                http://www.zess.uni-siegen.de/private/becker/
  35. Zentrum fuer Sensorsysteme (ZESS)
  36. http://www.zess.uni-siegen.de/private/becker/win95
  37.